package iterator;

import java.util.List;

public  abstract class Aggregate<T> {
    //为子类提供集合容器
    private final List<T> tList;

    public Aggregate(List<T> list) {
        tList=list;
    }

    boolean add(T t){
       return tList.add(t);
    }

    boolean remove(T t){
        return tList.remove(t);
    }

    List<T> getList(){
        return this.tList;
    }

    abstract Iterator createIterator();
}
